<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>创建OTA升级任务</title>
</head>
<body>
    <h1>创建OTA升级任务</h1>
    <form action="/create_ota_task" method="post">
        <label for="ecu_sn">ECU SN列表（多个用逗号分隔）:</label>
        <input type="text" id="ecu_sn" name="ecu_sn" required><br><br>

        <label for="product_name">产品名称:</label>
        <input type="text" id="product_name" name="product_name" required><br><br>

        <label for="hw_version">硬件版本:</label>
        <select id="hw_version" name="hw_version" required>
            <option value="">请选择硬件版本</option>
            {% for version in hw_version_list %}
            <option value="{{ version }}">{{ version }}</option>
            {% endfor %}
        </select><br><br>

        <label for="package_type">包类型:</label>
        <select id="package_type" name="package_type" required>
            <option value="">请选择包类型</option>
            {% for key, value in pkg_type_dict.items() %}
            <option value="{{ value }}">{{ key }}</option>
            {% endfor %}
        </select><br><br>

        <label for="current_version">当前版本:</label>
        <input type="text" id="current_version" name="current_version" required><br><br>

        <label for="target_version">目标版本:</label>
        <input type="text" id="target_version" name="target_version" required><br><br>

        <label for="mcu_version">MCU版本（可选）:</label>
        <input type="text" id="mcu_version" name="mcu_version"><br><br>

        <label for="times">创建任务次数:</label>
        <input type="number" id="times" name="times" value="1" required><br><br>

        <button type="submit">创建任务</button>
    </form>
</body>
</html>
